<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Stemmer token filter | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'analysis-stemmer-tokenfilter.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/analysis-stemmer-tokenfilter.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/analysis-stemmer-tokenfilter.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/analysis-stemmer-tokenfilter.html" rel="nofollow" target="_blank">../en/analysis-stemmer-tokenfilter.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="analysis.html">Text analysis</a></span>
»
<span class="breadcrumb-link"><a href="analysis-tokenfilters.html">Token filter reference</a></span>
»
<span class="breadcrumb-node">Stemmer token filter</span>
</div>
<div class="navheader">
<span class="prev">
<a href="analysis-snowball-tokenfilter.html">« Snowball token filter</a>
</span>
<span class="next">
<a href="analysis-stemmer-override-tokenfilter.html">Stemmer override token filter »</a>
</span>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="analysis-stemmer-tokenfilter"></a>Stemmer token filter<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/analysis/tokenfilters/stemmer-tokenfilter.asciidoc">edit</a>
</h2>
</div></div></div>

<p>Provides <a class="xref" href="stemming.html#algorithmic-stemmers" title="Algorithmic stemmers">algorithmic stemming</a> for several languages,
some with additional variants. For a list of supported languages, see the
<a class="xref" href="analysis-stemmer-tokenfilter.html#analysis-stemmer-tokenfilter-language-parm"><code class="literal">language</code></a> parameter.</p>
<p>When not customized, the filter uses the
<a href="http://snowball.tartarus.org/algorithms/porter/stemmer.html" class="ulink" target="_top">porter stemming
algorithm</a> for English.</p>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="analysis-stemmer-tokenfilter-analyze-ex"></a>Example<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/analysis/tokenfilters/stemmer-tokenfilter.asciidoc">edit</a>
</h3>
</div></div></div>
<p>The following analyze API request uses the <code class="literal">stemmer</code> filter’s default porter
stemming algorithm to stem <code class="literal">the foxes jumping quickly</code> to <code class="literal">the fox jump
quickli</code>:</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET /_analyze
{
  "tokenizer": "standard",
  "filter": [ "stemmer" ],
  "text": "the foxes jumping quickly"
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/985.console"></div>
<p>The filter produces the following tokens:</p>
<div class="pre_wrapper lang-text">
<pre class="programlisting prettyprint lang-text">[ the, fox, jump, quickli ]</pre>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="analysis-stemmer-tokenfilter-analyzer-ex"></a>Add to an analyzer<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/analysis/tokenfilters/stemmer-tokenfilter.asciidoc">edit</a>
</h3>
</div></div></div>
<p>The following <a class="xref" href="indices-create-index.html" title="Create index API">create index API</a> request uses the
<code class="literal">stemmer</code> filter to configure a new <a class="xref" href="analysis-custom-analyzer.html" title="Create a custom analyzer">custom
analyzer</a>.</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">PUT /my_index
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "tokenizer": "whitespace",
          "filter": [ "stemmer" ]
        }
      }
    }
  }
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/986.console"></div>
</div>

<div class="section child_attributes">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="analysis-stemmer-tokenfilter-configure-parms"></a>Configurable parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/analysis/tokenfilters/stemmer-tokenfilter.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<a id="analysis-stemmer-tokenfilter-language-parm"></a>
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">language</code>
</span>
</dt>
<dd>
<p>
(Optional, string)
Language-dependent stemming algorithm used to stem tokens. If both this and the
<code class="literal">name</code> parameter are specified, the <code class="literal">language</code> parameter argument is used.
</p>
<details open>
<summary class="title">Valid values for <code class="literal">language</code></summary>
<div class="content">
<p>Valid values are sorted by language. Defaults to
<a href="http://snowball.tartarus.org/algorithms/porter/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">english</code></strong></span></a>.
Recommended algorithms are <span class="strong strong"><strong>bolded</strong></span>.</p>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
Arabic
</span>
</dt>
<dd>
<a href="https://lucene.apache.org/core/8_5_1/analyzers-common/org/apache/lucene/analysis/ar/ArabicStemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">arabic</code></strong></span></a>
</dd>
<dt>
<span class="term">
Armenian
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/armenian/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">armenian</code></strong></span></a>
</dd>
<dt>
<span class="term">
Basque
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/basque/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">basque</code></strong></span></a>
</dd>
<dt>
<span class="term">
Bengali
</span>
</dt>
<dd>
<a href="http://www.tandfonline.com/doi/abs/10.1080/02564602.1993.11437284" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">bengali</code></strong></span></a>
</dd>
<dt>
<span class="term">
Brazilian Portuguese
</span>
</dt>
<dd>
<a href="https://lucene.apache.org/core/8_5_1/analyzers-common/org/apache/lucene/analysis/br/BrazilianStemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">brazilian</code></strong></span></a>
</dd>
<dt>
<span class="term">
Bulgarian
</span>
</dt>
<dd>
<a href="http://members.unine.ch/jacques.savoy/Papers/BUIR.pdf" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">bulgarian</code></strong></span></a>
</dd>
<dt>
<span class="term">
Catalan
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/catalan/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">catalan</code></strong></span></a>
</dd>
<dt>
<span class="term">
Czech
</span>
</dt>
<dd>
<a href="http://portal.acm.org/citation.cfm?id=1598600" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">czech</code></strong></span></a>
</dd>
<dt>
<span class="term">
Danish
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/danish/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">danish</code></strong></span></a>
</dd>
<dt>
<span class="term">
Dutch
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/dutch/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">dutch</code></strong></span></a>,
<a href="http://snowball.tartarus.org/algorithms/kraaij_pohlmann/stemmer.html" class="ulink" target="_top"><code class="literal">dutch_kp</code></a>
</dd>
<dt>
<span class="term">
English
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/porter/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">english</code></strong></span></a>,
<a href="http://ciir.cs.umass.edu/pubfiles/ir-35.pdf" class="ulink" target="_top"><code class="literal">light_english</code></a>,
<a href="http://snowball.tartarus.org/algorithms/lovins/stemmer.html" class="ulink" target="_top"><code class="literal">lovins</code></a>,
<a href="http://www.researchgate.net/publication/220433848_How_effective_is_suffixing" class="ulink" target="_top"><code class="literal">minimal_english</code></a>,
<a href="http://snowball.tartarus.org/algorithms/english/stemmer.html" class="ulink" target="_top"><code class="literal">porter2</code></a>,
<a href="https://lucene.apache.org/core/8_5_1/analyzers-common/org/apache/lucene/analysis/en/EnglishPossessiveFilter.html" class="ulink" target="_top"><code class="literal">possessive_english</code></a>
</dd>
<dt>
<span class="term">
Estonian
</span>
</dt>
<dd>
<a href="https://lucene.apache.org/core/8_5_1/analyzers-common/org/tartarus/snowball/ext/EstonianStemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">estonian</code></strong></span></a>
</dd>
<dt>
<span class="term">
Finnish
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/finnish/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">finnish</code></strong></span></a>,
<a href="http://clef.isti.cnr.it/2003/WN_web/22.pdf" class="ulink" target="_top"><code class="literal">light_finnish</code></a>
</dd>
<dt>
<span class="term">
French
</span>
</dt>
<dd>
<a href="http://dl.acm.org/citation.cfm?id=1141523" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">light_french</code></strong></span></a>,
<a href="http://snowball.tartarus.org/algorithms/french/stemmer.html" class="ulink" target="_top"><code class="literal">french</code></a>,
<a href="http://dl.acm.org/citation.cfm?id=318984" class="ulink" target="_top"><code class="literal">minimal_french</code></a>
</dd>
<dt>
<span class="term">
Galician
</span>
</dt>
<dd>
<a href="http://bvg.udc.es/recursos_lingua/stemming.jsp" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">galician</code></strong></span></a>,
<a href="http://bvg.udc.es/recursos_lingua/stemming.jsp" class="ulink" target="_top"><code class="literal">minimal_galician</code></a> (Plural step only)
</dd>
<dt>
<span class="term">
German
</span>
</dt>
<dd>
<a href="http://dl.acm.org/citation.cfm?id=1141523" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">light_german</code></strong></span></a>,
<a href="http://snowball.tartarus.org/algorithms/german/stemmer.html" class="ulink" target="_top"><code class="literal">german</code></a>,
<a href="http://snowball.tartarus.org/algorithms/german2/stemmer.html" class="ulink" target="_top"><code class="literal">german2</code></a>,
<a href="http://members.unine.ch/jacques.savoy/clef/morpho.pdf" class="ulink" target="_top"><code class="literal">minimal_german</code></a>
</dd>
<dt>
<span class="term">
Greek
</span>
</dt>
<dd>
<a href="http://sais.se/mthprize/2007/ntais2007.pdf" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">greek</code></strong></span></a>
</dd>
<dt>
<span class="term">
Hindi
</span>
</dt>
<dd>
<a href="http://computing.open.ac.uk/Sites/EACLSouthAsia/Papers/p6-Ramanathan.pdf" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">hindi</code></strong></span></a>
</dd>
<dt>
<span class="term">
Hungarian
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/hungarian/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">hungarian</code></strong></span></a>,
<a href="http://dl.acm.org/citation.cfm?id=1141523&amp;dl=ACM&amp;coll=DL&amp;CFID=179095584&amp;CFTOKEN=80067181" class="ulink" target="_top"><code class="literal">light_hungarian</code></a>
</dd>
<dt>
<span class="term">
Indonesian
</span>
</dt>
<dd>
<a href="http://www.illc.uva.nl/Publications/ResearchReports/MoL-2003-02.text.pdf" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">indonesian</code></strong></span></a>
</dd>
<dt>
<span class="term">
Irish
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/otherapps/oregan/intro.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">irish</code></strong></span></a>
</dd>
<dt>
<span class="term">
Italian
</span>
</dt>
<dd>
<a href="http://www.ercim.eu/publication/ws-proceedings/CLEF2/savoy.pdf" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">light_italian</code></strong></span></a>,
<a href="http://snowball.tartarus.org/algorithms/italian/stemmer.html" class="ulink" target="_top"><code class="literal">italian</code></a>
</dd>
<dt>
<span class="term">
Kurdish (Sorani)
</span>
</dt>
<dd>
<a href="https://lucene.apache.org/core/8_5_1/analyzers-common/org/apache/lucene/analysis/ckb/SoraniStemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">sorani</code></strong></span></a>
</dd>
<dt>
<span class="term">
Latvian
</span>
</dt>
<dd>
<a href="https://lucene.apache.org/core/8_5_1/analyzers-common/org/apache/lucene/analysis/lv/LatvianStemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">latvian</code></strong></span></a>
</dd>
<dt>
<span class="term">
Lithuanian
</span>
</dt>
<dd>
<a href="http://svn.apache.org/viewvc/lucene/dev/branches/lucene_solr_5_3/lucene/analysis/common/src/java/org/apache/lucene/analysis/lt/stem_ISO_8859_1.sbl?view=markup" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">lithuanian</code></strong></span></a>
</dd>
<dt>
<span class="term">
Norwegian (Bokmål)
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/norwegian/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">norwegian</code></strong></span></a>,
<a href="https://lucene.apache.org/core/8_5_1/analyzers-common/org/apache/lucene/analysis/no/NorwegianLightStemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">light_norwegian</code></strong></span></a>,
<a href="https://lucene.apache.org/core/8_5_1/analyzers-common/org/apache/lucene/analysis/no/NorwegianMinimalStemmer.html" class="ulink" target="_top"><code class="literal">minimal_norwegian</code></a>
</dd>
<dt>
<span class="term">
Norwegian (Nynorsk)
</span>
</dt>
<dd>
<a href="https://lucene.apache.org/core/8_5_1/analyzers-common/org/apache/lucene/analysis/no/NorwegianLightStemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">light_nynorsk</code></strong></span></a>,
<a href="https://lucene.apache.org/core/8_5_1/analyzers-common/org/apache/lucene/analysis/no/NorwegianMinimalStemmer.html" class="ulink" target="_top"><code class="literal">minimal_nynorsk</code></a>
</dd>
<dt>
<span class="term">
Portuguese
</span>
</dt>
<dd>
<a href="http://dl.acm.org/citation.cfm?id=1141523&amp;dl=ACM&amp;coll=DL&amp;CFID=179095584&amp;CFTOKEN=80067181" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">light_portuguese</code></strong></span></a>,
<a href="http://www.inf.ufrgs.br/~buriol/papers/Orengo_CLEF07.pdf" class="ulink" target="_top"><code class="literal">minimal_portuguese</code></a>,
<a href="http://snowball.tartarus.org/algorithms/portuguese/stemmer.html" class="ulink" target="_top"><code class="literal">portuguese</code></a>,
<a href="http://www.inf.ufrgs.br/%5C~viviane/rslp/index.htm" class="ulink" target="_top"><code class="literal">portuguese_rslp</code></a>
</dd>
<dt>
<span class="term">
Romanian
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/romanian/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">romanian</code></strong></span></a>
</dd>
<dt>
<span class="term">
Russian
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/russian/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">russian</code></strong></span></a>,
<a href="http://doc.rero.ch/lm.php?url=1000%2C43%2C4%2C20091209094227-CA%2FDolamic_Ljiljana_-_Indexing_and_Searching_Strategies_for_the_Russian_20091209.pdf" class="ulink" target="_top"><code class="literal">light_russian</code></a>
</dd>
<dt>
<span class="term">
Spanish
</span>
</dt>
<dd>
<a href="http://www.ercim.eu/publication/ws-proceedings/CLEF2/savoy.pdf" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">light_spanish</code></strong></span></a>,
<a href="http://snowball.tartarus.org/algorithms/spanish/stemmer.html" class="ulink" target="_top"><code class="literal">spanish</code></a>
</dd>
<dt>
<span class="term">
Swedish
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/swedish/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">swedish</code></strong></span></a>,
<a href="http://clef.isti.cnr.it/2003/WN_web/22.pdf" class="ulink" target="_top"><code class="literal">light_swedish</code></a>
</dd>
<dt>
<span class="term">
Turkish
</span>
</dt>
<dd>
<a href="http://snowball.tartarus.org/algorithms/turkish/stemmer.html" class="ulink" target="_top"><span class="strong strong"><strong><code class="literal">turkish</code></strong></span></a>
</dd>
</dl>
</div>
</div>
</details>
</dd>
<dt>
<span class="term">
<code class="literal">name</code>
</span>
</dt>
<dd>
An alias for the <a class="xref" href="analysis-stemmer-tokenfilter.html#analysis-stemmer-tokenfilter-language-parm"><code class="literal">language</code></a>
parameter. If both this and the <code class="literal">language</code> parameter are specified, the
<code class="literal">language</code> parameter argument is used.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="analysis-stemmer-tokenfilter-customize"></a>Customize<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/analysis/tokenfilters/stemmer-tokenfilter.asciidoc">edit</a>
</h3>
</div></div></div>
<p>To customize the <code class="literal">stemmer</code> filter, duplicate it to create the basis for a new
custom token filter. You can modify the filter using its configurable
parameters.</p>
<p>For example, the following request creates a custom <code class="literal">stemmer</code> filter that stems
words using the <code class="literal">light_german</code> algorithm:</p>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">PUT /my_index
{
  "settings": {
    "analysis": {
      "analyzer": {
        "my_analyzer": {
          "tokenizer": "standard",
          "filter": [
            "lowercase",
            "my_stemmer"
          ]
        }
      },
      "filter": {
        "my_stemmer": {
          "type": "stemmer",
          "language": "light_german"
        }
      }
    }
  }
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/987.console"></div>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="analysis-snowball-tokenfilter.html">« Snowball token filter</a>
</span>
<span class="next">
<a href="analysis-stemmer-override-tokenfilter.html">Stemmer override token filter »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>